package task06_05;

import java.io.BufferedReader;
import java.io.BufferedWriter;

import java.io.FileReader;
import java.io.FileWriter;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 8:45
 * @description:
 */
public class CopyFile {

  public static void main(String[] args) throws Exception {
    BufferedReader bufferedReader=new BufferedReader(new FileReader("a.txt"));
    BufferedWriter bufferedWriter=new BufferedWriter(new FileWriter("c:\\a.txt"));
    String line=null;
    while((line=bufferedReader.readLine())!=null){
     bufferedWriter.write(line);
     bufferedWriter.newLine();
     bufferedWriter.flush();
    }
    bufferedReader.close();
    bufferedWriter.close();
  }
}
